// Demo:   demo.cpp
// Author: Evan Pezent (evanpezent.com)
// Date:   3/26/2021

#include "App.h"
#include <imfilebrowser.h>

struct ImFileBrowser : App {
    using App::App;
    ImGui::FileBrowser fileDialog;
      void Start() override {
       fileDialog.SetTitle("title");
    fileDialog.SetTypeFilters({ ".h", ".cpp" });
    }
   
    void Update() override {
		  if(ImGui::Begin("dummy window文件浏览器"))
        {
            // open file dialog when user clicks this button
            if(ImGui::Button("open file dialog"))
                fileDialog.Open();
        }
        ImGui::End();
        
        fileDialog.Display();
        
        if(fileDialog.HasSelected())
        {
            std::cout << "Selected filename" << fileDialog.GetSelected().string() << std::endl;
            fileDialog.ClearSelected();
        }
    }
};

int main(int argc, char const *argv[])
{
  ImFileBrowser app("OpenGL IMGUI Demo演示",1920,1080,argc,argv);
    app.Run();

    return 0;
}
